package top.ffhome.multithread.ch08.demo02;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Main {
    //8-6
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newFixedThreadPool(5);

        try {
            new ClientThread("Alice", executorService).start();
            new ClientThread("Bobby", executorService).start();
            new ClientThread("Chris", executorService).start();
        } finally {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
            }
            executorService.shutdown();
        }
    }
}
